from django.shortcuts import render
from .models import Grade
from .models import Student

# Create your views here.


def get_grade(request):
    grade = Grade.objects.all()
    return render(request, 'myapp/grade.html', context={'grade': grade})


def get_student(request):
    grade = request.GET.get('grade_name')
    print(grade)
    students = Student.objects.filter(grade=grade)
    return render(request, 'myapp/student.html', context={'students': students})